package com.jiazhong.单例模式;
//从小到大
public class Test {
    public static void main(String[] args) {
        int a[]={8,7,6,5,4,3,2,1};
        int temp;
        for (int i=1;i<a.length;i++){
            System.out.println("第"+i+"轮排位:");
            for (int j=0;j<a.length-1;j++){
                if (a[j]>a[j+1]){
                    temp=a[j];
                    a[j]=a[j+1];
                    a[j+1]=temp;
                }
                System.out.print("第"+(j+1)+"次排位:");
                for (int index=0;index<a.length;index++){
                    System.out.print(a[index]+" ");
                }
                System.out.println();
            }
        }
    }
}
